﻿using System.Collections.Generic;
using OS.Infrastructure.Domain;

namespace TaskKernel.Domain
{
    public class Template : AbstractEntity
    {
        protected IList<Department> departments;

        protected Template()
        {
            departments = new List<Department>();
        }

        public Template(string name, Department department)
            : this()
        {
            Name = name;
            departments.Add(department);
        }

        public virtual string Name { get; protected set; }
        public virtual string ContentNameResource { get; protected set; }

        public virtual IEnumerable<Department> Departments
        {
            get { return departments; }
            protected set { }
        }

        public virtual void AddDepartment(Department department)
        {
            departments.Add(department);
        }

        public virtual void SetContentNameResource(string resourceName)
        {
            ContentNameResource = resourceName;
        }
    }
}